package com.uzhie.jt808.jt1078.entity.param8103;

import com.uzhie.jt808.JT808MsgBody;
import com.uzhie.jt808.msg.entity.MyBuffer;

/**
 * Created by zhangdequan on 2018/8/13.
 */
public class JT_8103_param_terminal_pause implements JT808MsgBody {

    //休眠唤醒模式
    private byte dormancy_mold;
    //唤醒条件类型
    private byte awaken_condition;
    //定时唤醒日设置
    private byte awaken_day;
    //定时唤醒启用标识
    private byte  awaken_flag;
    //时间段一唤醒时间
    private short time1_awaken_time;
    //时间段一关闭时间
    private short time1_close_time;
    //时间段二唤醒时间
    private short time2_awaken_time;
    //时间段二关闭时间
    private short time2_close_time;
    //时间段三唤醒时间
    private short time3_awaken_time;
    //时间段三关闭时间
    private short time3_close_time;
    //时间段四唤醒时间
    private short time4_awaken_time;
    //时间段四关闭时间
    private short time4_close_time;

    public byte getDormancy_mold() {
        return dormancy_mold;
    }

    public void setDormancy_mold(byte dormancy_mold) {
        this.dormancy_mold = dormancy_mold;
    }

    public byte getAwaken_condition() {
        return awaken_condition;
    }

    public void setAwaken_condition(byte awaken_condition) {
        this.awaken_condition = awaken_condition;
    }

    public byte getAwaken_day() {
        return awaken_day;
    }

    public void setAwaken_day(byte awaken_day) {
        this.awaken_day = awaken_day;
    }

    public byte getAwaken_flag() {
        return awaken_flag;
    }

    public void setAwaken_flag(byte awaken_flag) {
        this.awaken_flag = awaken_flag;
    }

    public short getTime1_awaken_time() {
        return time1_awaken_time;
    }

    public void setTime1_awaken_time(short time1_awaken_time) {
        this.time1_awaken_time = time1_awaken_time;
    }

    public short getTime1_close_time() {
        return time1_close_time;
    }

    public void setTime1_close_time(short time1_close_time) {
        this.time1_close_time = time1_close_time;
    }

    public short getTime2_awaken_time() {
        return time2_awaken_time;
    }

    public void setTime2_awaken_time(short time2_awaken_time) {
        this.time2_awaken_time = time2_awaken_time;
    }

    public short getTime2_close_time() {
        return time2_close_time;
    }

    public void setTime2_close_time(short time2_close_time) {
        this.time2_close_time = time2_close_time;
    }

    public short getTime3_awaken_time() {
        return time3_awaken_time;
    }

    public void setTime3_awaken_time(short time3_awaken_time) {
        this.time3_awaken_time = time3_awaken_time;
    }

    public short getTime3_close_time() {
        return time3_close_time;
    }

    public void setTime3_close_time(short time3_close_time) {
        this.time3_close_time = time3_close_time;
    }

    public short getTime4_awaken_time() {
        return time4_awaken_time;
    }

    public void setTime4_awaken_time(short time4_awaken_time) {
        this.time4_awaken_time = time4_awaken_time;
    }

    public short getTime4_close_time() {
        return time4_close_time;
    }

    public void setTime4_close_time(short time4_close_time) {
        this.time4_close_time = time4_close_time;
    }

    @Override
    public byte[] WriteToBytes() {
        MyBuffer buffer = new MyBuffer();
        buffer.put(getDormancy_mold());
        buffer.put(getAwaken_condition());
        buffer.put(getAwaken_day());
        buffer.put(getAwaken_flag());
        buffer.put(getTime1_awaken_time());
        buffer.put(getTime1_close_time());
        buffer.put(getTime2_awaken_time());
        buffer.put(getTime2_close_time());
        buffer.put(getTime3_awaken_time());
        buffer.put(getTime3_close_time());
        buffer.put(getTime4_awaken_time());
        buffer.put(getTime4_close_time());
        return buffer.array();
    }

    @Override
    public void ReadFromBytes(byte[] body) {
        MyBuffer buffer = new MyBuffer(body);
        setDormancy_mold(buffer.get());
        setAwaken_condition(buffer.get());
        setAwaken_day(buffer.get());
        setAwaken_flag(buffer.get());
        setTime1_awaken_time(buffer.getShort());
        setTime1_close_time(buffer.getShort());
        setTime2_awaken_time(buffer.getShort());
        setTime2_close_time(buffer.getShort());
        setTime3_awaken_time(buffer.getShort());
        setTime3_close_time(buffer.getShort());
        setTime4_awaken_time(buffer.getShort());
        setTime4_close_time(buffer.getShort());
    }
}
